package com.telit.firecommand.enums;

/**
 * Create by Chencf 2022/09/15
 * 上报枚举类
 */
public enum FireSourceTypeStatus {

    ONE(1,"卫星上报"),
    TWO(2,"护林员上报"),
    THREE(3,"管理员添加"),
    FOUR(4,"电话接警"),
    FIVE(5, "设备抓拍"),
    six(6, "地市平台报警");



    private Integer code;
    private String str;

    FireSourceTypeStatus(int code, String str) {
        this.code = code;
        this.str = str;
    }

    public Integer getCode() {
        return code;
    }

    public String getStr() {
        return str;
    }

    /**
     * 根据code  获取对应的str描述字符串
     */
    public static String code2Str(Integer code) {
        if (code==null)
            return null;
        for (FireSourceTypeStatus statusNum : FireSourceTypeStatus.values()) {
            if (statusNum.getCode().equals(code)) {
                return statusNum.getStr();
            }
        }
        return null;
    }

}
